package com.njtoyo.taxi.admin.mapper.master.entity;

import cn.hutool.core.date.DatePattern;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.njtoyo.taxi.admin.library.common.GeoPoint;
import com.njtoyo.taxi.admin.mapper.master.enums.RideOrderPaidThrough;
import com.njtoyo.taxi.admin.mapper.master.enums.RideOrderState;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;
import java.util.Objects;

@Data
public class OrderManageVo{
    //扫码行程id
    private Long id;
    //平台
    private String platform;
    //类型
    private String category;
    //订单号
    private String orderId;
    //司机
    private String driverName;
    //编号
    private String driverId;
    //电话
    private String driverPhoneNumber;
    //车牌号
    private String vehicleNumber;
    //乘客
    private String passengerName;
    //编号
    private String passengerId;
    //电话
    private String passengerPhoneNumber;
    //下单时间
    private String orderTime;
    //行政区
    private String areaName;
    //预约上车地
    private String callOriginName;
    //预约下车地
    private String callDestinationName;
    //实际上车地
    private String originName;
    //实际下车地
    private String destinationName;
    //计价方式
    private String pricingMethod;
    //是否预付单
    private String needPrepay;
    //支付金额
    private BigDecimal amount;
    //支付通道
    private String paidThrough;

    @ApiModelProperty(value = "0:unknown,1:cash,2:online,3:wxapp,4:wechat,5:alipay,6:saving,7:redpacket,8:jybwxapp,9:point,10:mixed,11:unionpay")
    private RideOrderPaidThrough presetThrough;
    //支付状态
    private String paidState;
    private RideOrderState paidStateEn;
    //订单状态
    private String orderState;
    private String orderStateEn;
    //订单属于哪个tab
    private String tabName;

    @ApiModelProperty(value = "是否抵扣首单立减优惠")
    private Boolean isDiscountable;

    @ApiModelProperty(value = "乘客扫码坐标")
    private GeoPoint destination;

    @ApiModelProperty(value = "司机当前坐标")
    private GeoPoint currentDriverLocate;

    @ApiModelProperty(value = "是否完成行程订单")
    private Boolean isFinished;

    @ApiModelProperty(value = "是否已取消 0:no[未取消],1:yes[已取消]")
    private Boolean isCancel;

    @ApiModelProperty(value = "是否退款")
    private Boolean refunded;
    @ApiModelProperty(value = "refunded为false,partialRefund为true为部分退款")
    private Boolean partialRefund;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        OrderManageVo order = (OrderManageVo) o;
        return Objects.equals(orderId, order.orderId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(orderId);
    }
}
